var DeleteConfirmBody = {
  template:'<div class="widget-dialog-body">'+
    '<div class="delete-confirm">确定要删除吗？</div>'+
    '<div class="delete-notice">永久删除的文件无法恢复</div>'+
    '</div>',
    methods:{
      "valid":function(){
        var pwds = $(this.$el).find("input:password");
        var pwd = pwds.eq(0).val();
        var confirmPwd = pwds.eq(1).val();
        if(pwd.length < 4 ){
          $(this.$el).find("div.error").html("密码设置过短");
        }else if(pwd.length > 50 ){
          $(this.$el).find("div.error").html("密码设置过长");
        }else if(pwd !== confirmPwd){
          $(this.$el).find("div.error").html("两次密码不一致");
        }else{
          return pwd;
        }
      }

    },
    mounted:function(){
      $(this.$el).find("div.error").html("");
      $(this.$el).find("input:password").val("");
    }
};
var DeleteConfirmDialog = {
  data:function(){
    return {"title":"永久删除"};
  },
  extends:Dialog,
  components:{
    "dialog-body" : DeleteConfirmBody
  },
  methods:{
    "doConfirm":function(event){
      alert(this.id)
      return true;
    }
  },
  mounted: function () {
    $(this.$el).find("button.btn[disabled]").removeAttr("disabled");
  }
}
